package com.jc.subject.common.enums;

/**
 * @Description: 题目类型枚举
 * @Author: ASL_ly
 * @Package: com.jc.subject.common.enums
 * @Project: jc-club
 * @Date: 2024/10/23  20:30
 */
public enum SubjectInfoTypeEnum {

    RADIO(1, "单选"),
    MULTIPLE(2, "多选"),
    JUDGE(3, "判断"),
    BRIEF(4, "简答");

    public Integer code;
    public String desc;

    SubjectInfoTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public static SubjectInfoTypeEnum getByCode(Integer codeVal){
        for(SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()){
            if(resultCodeEnum.code == codeVal){
                return resultCodeEnum;
            }
        }
        return null;
    }
}

